Page({

  /**
   * 页面的初始数据
   */
  data: {
    //轮播图数组
    swiperList:[
      {
        id: 0,
        image_src:"https://api-hmugo-web.itheima.net/pyg/banner3.png"
      },
      {
        id: 1,
        image_src:"https://api-hmugo-web.itheima.net/pyg/banner2.png"
      },
      {
        id: 2,
        image_src:"https://aecpm.alicdn.com/simba/img/TB1XotJXQfb_uJkSnhJSuvdDVXa.jpg"
      },
      {
        id: 1,
        image_src:"https://imgcps.jd.com/ling4/100019131146/57K-6YCJ5aW954mp/54iG5qy-56eS5p2A/p-5bd8253082acdd181d02fa7a/2f4ba4b0/cr/s/q.jpg"
      }
    ],
    // 导航数组
    catesList:[
      {
        name:"服饰",
        image_src:"//m.360buyimg.com/mobilecms/s120x120_jfs/t1/140012/8/1804/3641/5efbf318E38bd5dad/0db99d859ab16ce9.png"
      },
      {
        name:"数码电器",
        image_src:"//m.360buyimg.com/mobilecms/s120x120_jfs/t1/135931/4/3281/5598/5efbf2c0Edbdc82c7/ed9861b4ddfb9f30.png"
      },
      {
        name:"护肤品",
        image_src:"//m.360buyimg.com/mobilecms/s120x120_jfs/t1/123571/19/6008/3747/5efbf6b2E03153a36/9ddc9036ba1c11a1.png.webp"
      },
      {
        name:"分类",
        image_src:"//m.360buyimg.com/mobilecms/s120x120_jfs/t1/112559/35/11283/3523/5efbf774E285d108b/c0fa626df4979a21.png.webp"
      },
      {
        name:"生鲜水果",
        image_src:"//m.360buyimg.com/mobilecms/s120x120_jfs/t1/129215/21/5978/3618/5efbf344Ebec23ae8/59712d986b10bb0a.png.webp"
      },
      {
        name:"手机充值",
        image_src:"//m.360buyimg.com/mobilecms/s120x120_jfs/t1/146390/3/1846/4909/5efbf39aEe5f5f797/300071558a9ab078.png"
      },
      {
        name:"领红包",
        image_src:"//m.360buyimg.com/mobilecms/s120x120_jfs/t1/131663/33/3380/3674/5efbf50fEf79cf314/af4b57d2383e605d.png"
      },
      {
        name:"优惠卷",
        image_src:"//m.360buyimg.com/mobilecms/s120x120_jfs/t1/113589/24/11332/4897/5efbf3feE705d87db/e5c12d5e943266b9.png"
      }
    ],
    // 楼层数据
    floorList:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this
    //获取楼层数据
    wx.request({
      url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/floordata',
      success:function(res){
        // console.log(res)
        that.setData({
          floorList:res.data.message
        })
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    
  }
})